{% extends 'base.html' %}
{% block right-panel-content %}
    <h3 style="text-align:center">Search Results</h3>
    {% for i in movie %}
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-3 column">
                    <img class="img-thumbnail movie-image" alt="140x140" src="{{ MEDIA_URL }}{{ movie.image_link }}" width=140px
                         height=140px/></div>
                <div class="col-md-7 column">
                    <h3>
                        <a href="{% url 'movie' i.id %}">    {{ i.title }}</a>
                    </h3>
                    <p>{{ i.intro | slice:":100" }}......</p>
                    <p>Views:{{ i.num }}</p>
                </div>
            </div>
        </div>
    {% endfor %}
    <div class="container-fluid">
        <ul class="pagination" id="pager">
            {#上一页按钮开始#}
            {# 如果当前页有上一页#}
            {% if movie.has_previous %}
                {#  当前页的上一页按钮正常使用#}
                <li class="previous"><a href="/allmovie/?page={{ movie.previous_page_number }}">上一页</a></li>
            {% else %}
                {# 当前页的不存在上一页时,上一页的按钮不可用#}
                <li class="previous disabled"><a href="#">上一页</a></li>
            {% endif %}
            {#上一页按钮结束#}
            {# 页码开始#}

            <li class="item active"><a href="/allmovie/?page={{ movie.number }}">{{ movie.number }}</a></li>
            <li class="item"><a href="/allmovie/?page={{ movie.number|add:1 }}">{{ movie.number|add:1 }}</a></li>
            <li class="item"><a href="/allmovie/?page={{ movie.number|add:2 }}">{{ movie.number|add:2 }}</a></li>
            {#页码结束#}
            {# 下一页按钮开始#}
            {% if movie.has_next %}
                <li class="next"><a href="/allmovie/?page={{ movie.next_page_number }}">Next Page</a></li>
            {% else %}
                <li class="next disabled"><a href="#">Next Page</a></li>
            {% endif %}
            <li class="item"><a href="#">
                {{ movie.number }}/{{ movie.paginator.num_pages }}</a>
            </li>

        </ul>
    </div>
{% endblock %}
